package com.zero.seata.service;

import com.zero.seata.mapper.OrderMapper;
import com.zero.seata.common.entity.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author zero
 */
@Service
public class OrderService {

    @Autowired
    private OrderMapper mapper;

    @Transactional(rollbackFor = Exception.class)
    public void addOrder(Order order) {
        mapper.insert(order);
    }
}
